本文整理汇总了PHP中TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv方法的典型用法代码示例。如果您正苦于以下问题:PHP GeneralUtility::getIndpEnv方法的具体用法?PHP GeneralUtility::getIndpEnv怎么用?PHP GeneralUtility::getIndpEnv使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TYPO3\CMS\Core\Utility\GeneralUtility
的用法示例。
在下文中一共展示了GeneralUtility::getIndpEnv方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getExtensionSummary
/**
* Returns information about this extension plugin
*
* @param array $params Parameters to the hook
*
* @return string Information about pi1 plugin
* @hook TYPO3_CONF_VARS|SC_OPTIONS|cms/layout/class.tx_cms_layout.php|list_type_Info|calendarize_calendar
*/
public function getExtensionSummary(array $params)
{
$relIconPath = GeneralUtility::getIndpEnv('TYPO3_SITE_URL') . ExtensionManagementUtility::siteRelPath('calendarize') . 'ext_icon.png';
$this->flexFormService = GeneralUtility::makeInstance('HDNET\\Calendarize\\Service\\FlexFormService');
$this->layoutService = GeneralUtility::makeInstance('HDNET\\Calendarize\\Service\\ContentElementLayoutService');
$this->layoutService->setTitle('<img src="' . $relIconPath . '" /> Calendarize');
if ($params['row']['list_type'] != 'calendarize_calendar') {
return '';
}
$this->flexFormService->load($params['row']['pi_flexform']);
if (!$this->flexFormService->isValid()) {
return '';
}
$actions = $this->flexFormService->get('switchableControllerActions', 'main');
$parts = GeneralUtility::trimExplode(';', $actions, true);
$parts = array_map(function ($element) {
$split = explode('->', $element);
return ucfirst($split[1]);
}, $parts);
$actionKey = lcfirst(implode('', $parts));
$this->layoutService->addRow(LocalizationUtility::translate('mode', 'calendarize'), LocalizationUtility::translate('mode.' . $actionKey, 'calendarize'));
$this->layoutService->addRow(LocalizationUtility::translate('configuration', 'calendarize'), $this->flexFormService->get('settings.configuration', 'main'));
if ((bool) $this->flexFormService->get('settings.hidePagination', 'main')) {
$this->layoutService->addRow(LocalizationUtility::translate('hide.pagination.teaser', 'calendarize'), '!!!');
}
$this->addPageIdsToTable();
return $this->layoutService->render();
}
示例2: render
/**
* Render the captcha image html
*
* @param string suffix to be appended to the extenstion key when forming css class names
* @return string The html used to render the captcha image
*/
public function render($suffix = '')
{
$value = '';
// Include the required JavaScript
$GLOBALS['TSFE']->additionalHeaderData[$this->extensionKey . '_freeCap'] = '<script type="text/javascript" src="' . GeneralUtility::createVersionNumberedFilename(ExtensionManagementUtility::siteRelPath($this->extensionKey) . 'Resources/Public/JavaScript/freeCap.js') . '"></script>';
// Disable caching
$GLOBALS['TSFE']->no_cache = 1;
// Get the plugin configuration
$settings = $this->configurationManager->getConfiguration(ConfigurationManagerInterface::CONFIGURATION_TYPE_SETTINGS, $this->extensionName);
// Get the translation view helper
$objectManager = GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager');
$translator = $objectManager->get('SJBR\\SrFreecap\\ViewHelpers\\TranslateViewHelper');
$translator->injectConfigurationManager($this->configurationManager);
// Generate the image url
$fakeId = GeneralUtility::shortMD5(uniqid(rand()), 5);
$siteURL = GeneralUtility::getIndpEnv('TYPO3_SITE_URL');
$L = GeneralUtility::_GP('L');
$urlParams = array('eID' => 'sr_freecap_EidDispatcher', 'id' => $GLOBALS['TSFE']->id, 'vendorName' => 'SJBR', 'extensionName' => 'SrFreecap', 'pluginName' => 'ImageGenerator', 'controllerName' => 'ImageGenerator', 'actionName' => 'show', 'formatName' => 'png', 'L' => $GLOBALS['TSFE']->sys_language_uid);
if ($GLOBALS['TSFE']->MP) {
$urlParams['MP'] = $GLOBALS['TSFE']->MP;
}
$urlParams['set'] = $fakeId;
$imageUrl = $siteURL . 'index.php?' . ltrim(GeneralUtility::implodeArrayForUrl('', $urlParams), '&');
// Generate the html text
$value = '<img' . $this->getClassAttribute('image', $suffix) . ' id="tx_srfreecap_captcha_image_' . $fakeId . '"' . ' src="' . htmlspecialchars($imageUrl) . '"' . ' alt="' . $translator->render('altText') . ' "/>' . '<span' . $this->getClassAttribute('cant-read', $suffix) . '>' . $translator->render('cant_read1') . ' <a href="#" onclick="this.blur();' . $this->extensionName . '.newImage(\'' . $fakeId . '\', \'' . $translator->render('noImageMessage') . '\');return false;">' . $translator->render('click_here') . '</a>' . $translator->render('cant_read2') . '</span>';
return $value;
}
示例3: init
/**
* Initialize
*
* @return void
*/
protected function init()
{
// Initialize GPvars:
$this->target = GeneralUtility::_GP('target');
$this->returnUrl = GeneralUtility::sanitizeLocalUrl(GeneralUtility::_GP('returnUrl'));
if (!$this->returnUrl) {
$this->returnUrl = GeneralUtility::getIndpEnv('TYPO3_SITE_URL') . TYPO3_mainDir . BackendUtility::getModuleUrl('file_list') . '&id=' . rawurlencode($this->target);
}
// Create the folder object
if ($this->target) {
$this->folderObject = \TYPO3\CMS\Core\Resource\ResourceFactory::getInstance()->retrieveFileOrFolderObject($this->target);
}
if ($this->folderObject->getStorage()->getUid() === 0) {
throw new \TYPO3\CMS\Core\Resource\Exception\InsufficientFolderAccessPermissionsException('You are not allowed to access folders outside your storages', 1375889834);
}
// Cleaning and checking target directory
if (!$this->folderObject) {
$title = $this->getLanguageService()->sL('LLL:EXT:lang/locallang_mod_file_list.xlf:paramError', TRUE);
$message = $this->getLanguageService()->sL('LLL:EXT:lang/locallang_mod_file_list.xlf:targetNoDir', TRUE);
throw new \RuntimeException($title . ': ' . $message, 1294586843);
}
// Setting the title and the icon
$icon = \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('apps-filetree-root');
$this->title = $icon . htmlspecialchars($this->folderObject->getStorage()->getName()) . ': ' . htmlspecialchars($this->folderObject->getIdentifier());
// Setting template object
$this->doc = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Template\DocumentTemplate::class);
$this->doc->setModuleTemplate('EXT:backend/Resources/Private/Templates/file_upload.html');
$this->doc->backPath = $GLOBALS['BACK_PATH'];
$this->doc->form = '<form action="' . htmlspecialchars(BackendUtility::getModuleUrl('tce_file')) . '" method="post" name="editform" enctype="' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['form_enctype'] . '">';
}
示例4: analyseUserGroups
/**
* Analyses user groups
*
* @param array $reports
* @return void
*/
protected function analyseUserGroups(&$reports)
{
/** @var \AOE\AoeIpauth\Domain\Service\FeEntityService $service */
$service = $this->objectManager->get('AOE\\AoeIpauth\\Domain\\Service\\FeEntityService');
$userGroups = $service->findAllGroupsWithIpAuthentication();
if (empty($userGroups)) {
// Message that no user group has IP authentication
$reports[] = $this->objectManager->get('TYPO3\\CMS\\Reports\\Status', 'IP Usergroup Authentication', 'No user groups with IP authentication found', 'No user groups were found anywhere that are active and have an automatic IP authentication enabled.' . 'Your current IP is: <strong>' . $this->myIp . '</strong>', \TYPO3\CMS\Reports\Status::INFO);
} else {
$thisUrl = urlencode(GeneralUtility::getIndpEnv('TYPO3_REQUEST_URL'));
$userGroupInfo = '<br /><br /><table cellpadding="4" cellspacing="0" border="0">';
$userGroupInfo .= '<thead><tr><th style="padding-bottom: 10px;">User Group</th><th>IP/Range</th></tr></thead>';
$userGroupInfo .= '<tbody>';
// Add user group strings
foreach ($userGroups as $group) {
$uid = $group['uid'];
$ips = implode(', ', $group['tx_aoeipauth_ip']);
$fullRecord = BackendUtility::getRecord('fe_groups', $uid);
$title = $fullRecord['title'];
$button = '<a title="Edit record" onclick="window.location.href=\'alt_doc.php?returnUrl=' . $thisUrl . '&edit[fe_groups][' . $uid . ']=edit\'; return false;" href="#">' . '<span class="t3-icon t3-icon-actions t3-icon-actions-document t3-icon-document-open"> </span>' . '</a>';
$userGroupInfo .= '<tr><td style="padding: 0 20px 0 0;">' . $button . $title . '</td><td>' . $ips . '</td></tr>';
}
$userGroupInfo .= '</tbody>';
$userGroupInfo .= '</table>';
$userGroupInfo .= '<br /><br />Your current IP is: <strong>' . $this->myIp . '</strong>';
// Inform about the groups
$reports[] = $this->objectManager->get('tx_reports_reports_status_Status', 'IP Usergroup Authentication', 'Some groups with automatic IP authentication were found.', $userGroupInfo, \TYPO3\CMS\Reports\Status::OK);
}
}
示例5: main
/**
* Main function
* Will issue a location-header, redirecting either BACK or to a new alt_doc.php instance...
*
* @return void
* @todo Define visibility
*/
public function main()
{
// Get this record
$origRow = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecord($this->P['table'], $this->P['uid']);
// Get TSconfig for it.
$TSconfig = \TYPO3\CMS\Backend\Utility\BackendUtility::getTCEFORM_TSconfig($this->table, is_array($origRow) ? $origRow : array('pid' => $this->P['pid']));
// Set [params][pid]
if (substr($this->P['params']['pid'], 0, 3) == '###' && substr($this->P['params']['pid'], -3) == '###') {
$this->pid = intval($TSconfig['_' . substr($this->P['params']['pid'], 3, -3)]);
} else {
$this->pid = intval($this->P['params']['pid']);
}
// Make redirect:
// If pid is blank OR if id is set, then return...
if (!strcmp($this->pid, '') || strcmp($this->id, '')) {
$redirectUrl = \TYPO3\CMS\Core\Utility\GeneralUtility::sanitizeLocalUrl($this->P['returnUrl']);
} else {
// Otherwise, show the list:
$urlParameters = array();
$urlParameters['id'] = $this->pid;
$urlParameters['table'] = $this->P['params']['table'];
$urlParameters['returnUrl'] = \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('REQUEST_URI');
$redirectUrl = \TYPO3\CMS\Backend\Utility\BackendUtility::getModuleUrl('web_list', $urlParameters);
}
\TYPO3\CMS\Core\Utility\HttpUtility::redirect($redirectUrl);
}
示例6: enableRsaEncryption
/**
* Load all necessary Javascript files
*
* @param bool $useRequireJsModule
*/
public function enableRsaEncryption($useRequireJsModule = false)
{
if ($this->moduleLoaded || !$this->isAvailable()) {
return;
}
$this->moduleLoaded = true;
$pageRenderer = GeneralUtility::makeInstance(PageRenderer::class);
// Include necessary javascript files
if ($useRequireJsModule) {
$pageRenderer->loadRequireJsModule('TYPO3/CMS/Rsaauth/RsaEncryptionModule');
} else {
// Register ajax handler url
$code = 'var TYPO3RsaEncryptionPublicKeyUrl = ' . GeneralUtility::quoteJSvalue(GeneralUtility::getIndpEnv('TYPO3_SITE_URL') . 'index.php?eID=RsaPublicKeyGenerationController') . ';';
$pageRenderer->addJsInlineCode('TYPO3RsaEncryptionPublicKeyUrl', $code);
$javascriptPath = ExtensionManagementUtility::siteRelPath('rsaauth') . 'Resources/Public/JavaScript/';
if (!$GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['debug']) {
$files = array('RsaEncryptionWithLib.min.js');
} else {
$files = array('RsaLibrary.js', 'RsaEncryption.js');
}
foreach ($files as $file) {
$pageRenderer->addJsFile($javascriptPath . $file);
}
}
}
示例7: initializeTemplateContainer
/**
* Initializes an anonymous template container.
* The created container can be compared to "record_edit" module in backend-only disposal.
*
* @return void
*/
public function initializeTemplateContainer()
{
$GLOBALS['TBE_TEMPLATE'] = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Template\FrontendDocumentTemplate::class);
$GLOBALS['TBE_TEMPLATE']->getPageRenderer()->addInlineSetting('', 'PATH_typo3', GeneralUtility::dirname(GeneralUtility::getIndpEnv('SCRIPT_NAME')) . '/' . TYPO3_mainDir);
$GLOBALS['SOBE'] = new \stdClass();
$GLOBALS['SOBE']->doc = $GLOBALS['TBE_TEMPLATE'];
}
示例8: render
/**
* Render a share button
*
* @param boolean $loadJs
* @return string
*/
public function render($loadJs = TRUE)
{
if (!empty($this->arguments['type'])) {
$this->tag->addAttribute('data-type', $this->arguments['type']);
$this->tag->removeAttribute('type');
} else {
$this->tag->addAttribute('data-type', 'button_count');
}
$shareUrl = empty($this->arguments['shareurl']) ? \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_REQUEST_URL') : $this->arguments['shareurl'];
$this->tag->addAttribute('data-href', $shareUrl);
$this->tag->removeAttribute('shareurl');
$this->tag->addAttribute('class', 'fb-share-button');
$this->tag->setContent(' ');
$code = $this->tag->render();
if ($loadJs) {
$code .= '<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/de_DE/sdk.js";
fjs.parentNode.insertBefore(js, fjs);
}(document, \'script\', \'facebook-jssdk\'));</script>';
}
// Social interaction Google Analytics
if ($this->pluginSettingsService->getByPath('analytics.social.facebookShare') == 1) {
$code .= \TYPO3\CMS\Core\Utility\GeneralUtility::wrapJS("\n\t\t\t\tFB.Event.subscribe('message.send', function(targetUrl) {\n\t\t\t\t _gaq.push(['_trackSocial', 'facebook', 'send', targetUrl]);\n\t\t\t\t});\n\t\t\t");
}
return $code;
}
示例9: main
/**
* Default action.
*
* @return array
* @throws \RuntimeException
*/
public function main()
{
$this->init();
$allowedIps = GeneralUtility::trimExplode(',', $this->config['allowedIps'], true);
if ($this->config['debug']) {
GeneralUtility::sysLog('Connection from ' . GeneralUtility::getIndpEnv('REMOTE_ADDR'), self::$extKey);
}
if ($this->config['mode'] !== 'M' || count($allowedIps) && !in_array(GeneralUtility::getIndpEnv('REMOTE_ADDR'), $allowedIps)) {
$this->denyAccess();
}
// Initialize TCA (method handles if not already initialized)
if (version_compare(TYPO3_version, '7.6', '>=')) {
\TYPO3\CMS\Frontend\Utility\EidUtility::initTCA();
}
$this->initTSFE();
if (!empty($this->config['synchronizeDeletedAccounts']) && $this->config['synchronizeDeletedAccounts']) {
$additionalFields = ', deleted';
$additionalWhere = '';
} else {
$additionalFields = '';
$additionalWhere = ' AND deleted=0';
}
$administrators = $this->getDatabaseConnection()->exec_SELECTgetRows('username, admin, disable, realName, email, TSconfig, starttime, endtime, lang, tx_openid_openid' . $additionalFields, 'be_users', 'admin=1 AND tx_openid_openid<>\'\'' . $additionalWhere);
if (count($administrators)) {
$key = $this->config['preSharedKey'];
$data = json_encode($administrators);
$encrypted = mcrypt_encrypt(MCRYPT_RIJNDAEL_256, md5($key), $data, MCRYPT_MODE_CBC, md5(md5($key)));
$encrypted = base64_encode($encrypted);
return $encrypted;
} else {
throw new \RuntimeException('No administrators found', 1327586994);
}
}
示例10: render
/**
* Render a share button
*
* @param string $title Title for share
* @param string $text Title for share
* @param string $shareUrl Title for share
* @return string
*/
public function render($title = NULL, $text = NULL, $shareUrl = NULL)
{
// check defaults
if (empty($this->arguments['name'])) {
$this->tag->addAttribute('name', 'fb_share');
}
if (empty($this->arguments['type'])) {
$this->tag->addAttribute('type', 'link');
}
if (empty($this->arguments['target'])) {
$this->tag->addAttribute('target', '_blank');
}
$url = 'https://twitter.com/intent/tweet';
$url .= '?original_referer=' . urldecode(\TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_REQUEST_URL'));
$url .= '&url=';
if ($shareUrl) {
$url .= urldecode($shareUrl);
} else {
$url .= urldecode(\TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_REQUEST_URL'));
}
if ($title) {
$url .= '&p[title]=' . urldecode($title);
}
if ($text) {
$url .= '&text=' . urldecode($text);
}
$this->tag->addAttribute('href', $url);
$this->tag->setContent($this->renderChildren());
return $this->tag->render();
}
示例11: handleNoNewsFoundError
/**
* Error handling if no news entry is found
*
* @param string $configuration configuration what will be done
* @throws InvalidArgumentException
* @return void
*/
protected function handleNoNewsFoundError($configuration)
{
if (empty($configuration)) {
return;
}
$configuration = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $configuration, TRUE);
switch ($configuration[0]) {
case 'redirectToListView':
$this->redirect('list');
break;
case 'redirectToPage':
if (count($configuration) === 1 || count($configuration) > 3) {
$msg = sprintf('If error handling "%s" is used, either 2 or 3 arguments, split by "," must be used', $configuration[0]);
throw new InvalidArgumentException($msg);
}
$this->uriBuilder->reset();
$this->uriBuilder->setTargetPageUid($configuration[1]);
$this->uriBuilder->setCreateAbsoluteUri(TRUE);
if (\TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_SSL')) {
$this->uriBuilder->setAbsoluteUriScheme('https');
}
$url = $this->uriBuilder->build();
if (isset($configuration[2])) {
$this->redirectToUri($url, 0, (int) $configuration[2]);
} else {
$this->redirectToUri($url);
}
break;
case 'pageNotFoundHandler':
$GLOBALS['TSFE']->pageNotFoundAndExit('No news entry found.');
break;
default:
// Do nothing, it might be handled in the view.
}
}
示例12: getInfo
/**
* Main Function
*
* @param array $params
* @param object $pObj
* @return string
*/
public function getInfo($params = array(), $pObj)
{
// settings
$confArr = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['powermail']);
if ($confArr['disablePluginInformation']) {
return '';
}
$this->params = $params;
// $returnUrl = 'alt_doc.php?edit[tt_content][' . $pa['row']['uid'] . ']=edit&returnUrl=' . GeneralUtility::_GET('returnUrl');
// $returnUrl = rawurlencode($returnUrl);
$returnUrl = rawurlencode(Div::getSubFolderOfCurrentUrl() . GeneralUtility::getIndpEnv('TYPO3_SITE_SCRIPT'));
$editFormLink = Div::getSubFolderOfCurrentUrl() . 'typo3/alt_doc.php?edit[tx_powermail_domain_model_forms][' . $this->getFormProperty($this->getFieldFromFlexform('main', 'settings.flexform.main.form'), 'uid') . ']=edit';
$editFormLink .= '&returnUrl=' . $returnUrl;
// let's go
$array = array($GLOBALS['LANG']->sL($this->locallangPath . 'receiverEmail') => $this->getFieldFromFlexform('receiver', 'settings.flexform.receiver.email'), $GLOBALS['LANG']->sL($this->locallangPath . 'receiverName') => $this->getFieldFromFlexform('receiver', 'settings.flexform.receiver.name'), $GLOBALS['LANG']->sL($this->locallangPath . 'subject') => $this->getFieldFromFlexform('receiver', 'settings.flexform.receiver.subject'), $GLOBALS['LANG']->sL($this->locallangPath . 'form') => '<a href="' . $editFormLink . '" style="text-decoration:underline;">' . $this->getFormProperty($this->getFieldFromFlexform('main', 'settings.flexform.main.form')) . '</a>', $GLOBALS['LANG']->sL($this->locallangPath . 'confirmationPage') => '<img src="' . Div::getSubFolderOfCurrentUrl() . 'typo3conf/ext/powermail/Resources/Public/Image/icon-check.png" alt="1" />', $GLOBALS['LANG']->sL($this->locallangPath . 'optin') => '<img src="' . Div::getSubFolderOfCurrentUrl() . 'typo3conf/ext/powermail/Resources/Public/Image/icon-check.png" alt="1" />');
if (!$this->getFieldFromFlexform('main', 'settings.flexform.main.confirmation')) {
$array[$GLOBALS['LANG']->sL($this->locallangPath . 'confirmationPage')] = '<img src="' . Div::getSubFolderOfCurrentUrl() . 'typo3conf/ext/powermail/Resources/Public/Image/icon-notchecked.png" alt="0" />';
}
if (!$this->getFieldFromFlexform('main', 'settings.flexform.main.optin')) {
$array[$GLOBALS['LANG']->sL($this->locallangPath . 'optin')] = '<img src="' . Div::getSubFolderOfCurrentUrl() . 'typo3conf/ext/powermail/Resources/Public/Image/icon-notchecked.png" alt="0" />';
}
if ($this->showTable) {
return $this->createOutput($array);
}
return '';
}
示例13: getVideoData
/**
* getVideoData
*
* @param $settings
* @return
*/
public function getVideoData($settings)
{
$this->fullURL = \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_SITE_URL');
//$this->cObject = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tslib_cObj');
$limit = '';
if (isset($settings['limit']) && $settings['limit'] > 0) {
$limit = $settings['limit'];
}
$field = 'uid, upload_video, alttag, background_image';
$table = 'tx_video_domain_model_videos';
$orderBy = ' uid asc ';
//$groupBy = " ";
$where = ' ';
if (isset($settings['storagePID']) && $settings['storagePID'] != '') {
$where .= ' AND pid in (' . $settings['storagePID'] . ') ';
}
$where = ' deleted = 0 AND hidden = 0' . $where;
$conf = $this->getDBHandle()->exec_SELECTgetRows($field, $table, $where, $groupBy, $orderBy, $limit);
// echo $this->getDBHandle()->SELECTquery($field,$table,$where,$groupBy,$orderBy,$limit); die;
$data = array();
foreach ($conf as $key => $value) {
$data[$value['uid']] = $value;
if ($value['background_image'] > 0) {
$field1 = 'uid';
$table1 = 'sys_file_reference';
$where1 = ' tablenames = \'tx_video_domain_model_videos\' AND fieldname = \'backgroundImage\' AND uid_foreign = \'' . $value['uid'] . '\' AND deleted = 0 AND hidden = 0';
$res = $this->getDBHandle()->exec_SELECTgetRows($field1, $table1, $where1);
$data[$value['uid']]['imageReference'] = $res[0]['uid'];
}
}
return $data;
}
示例14: init
/**
* Constructor for initializing the class
*
* @return void
* @todo Define visibility
*/
public function init()
{
// Initialize GPvars:
$this->target = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('target');
$this->returnUrl = \TYPO3\CMS\Core\Utility\GeneralUtility::sanitizeLocalUrl(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('returnUrl'));
if (!$this->returnUrl) {
$this->returnUrl = \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_SITE_URL') . TYPO3_mainDir . \TYPO3\CMS\Backend\Utility\BackendUtility::getModuleUrl('file_list') . '&id=' . rawurlencode($this->target);
}
// Create the folder object
if ($this->target) {
$this->folderObject = \TYPO3\CMS\Core\Resource\ResourceFactory::getInstance()->retrieveFileOrFolderObject($this->target);
}
// Cleaning and checking target directory
if (!$this->folderObject) {
$title = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_file_list.xml:paramError', TRUE);
$message = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_file_list.xml:targetNoDir', TRUE);
throw new \RuntimeException($title . ': ' . $message, 1294586843);
}
// Setting the title and the icon
$icon = \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('apps-filetree-root');
$this->title = $icon . htmlspecialchars($this->folderObject->getStorage()->getName()) . ': ' . htmlspecialchars($this->folderObject->getIdentifier());
// Setting template object
$this->doc = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Template\\DocumentTemplate');
$this->doc->setModuleTemplate('templates/file_upload.html');
$this->doc->backPath = $GLOBALS['BACK_PATH'];
$this->doc->form = '<form action="tce_file.php" method="post" name="editform" enctype="' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['form_enctype'] . '">';
}
示例15: loginFormHook
/**
* Hooks to the felogin extension to provide additional code for FE login
*
* @return array 0 => onSubmit function, 1 => extra fields and required files
*/
public function loginFormHook()
{
$result = array(0 => '', 1 => '');
if (trim($GLOBALS['TYPO3_CONF_VARS']['FE']['loginSecurityLevel']) === 'rsa') {
$backend = \TYPO3\CMS\Rsaauth\Backend\BackendFactory::getBackend();
if ($backend) {
$result[0] = 'tx_rsaauth_feencrypt(this);';
$javascriptPath = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath('rsaauth') . 'resources/';
$files = array('jsbn/jsbn.js', 'jsbn/prng4.js', 'jsbn/rng.js', 'jsbn/rsa.js', 'jsbn/base64.js', 'rsaauth_min.js');
foreach ($files as $file) {
$result[1] .= '<script type="text/javascript" src="' . \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_SITE_URL') . $javascriptPath . $file . '"></script>';
}
// Generate a new key pair
$keyPair = $backend->createNewKeyPair();
// Save private key
$storage = \TYPO3\CMS\Rsaauth\Storage\StorageFactory::getStorage();
/** @var $storage \TYPO3\CMS\Rsaauth\Storage\AbstractStorage */
$storage->put($keyPair->getPrivateKey());
// Add RSA hidden fields
$result[1] .= '<input type="hidden" id="rsa_n" name="n" value="' . htmlspecialchars($keyPair->getPublicKeyModulus()) . '" />';
$result[1] .= '<input type="hidden" id="rsa_e" name="e" value="' . sprintf('%x', $keyPair->getExponent()) . '" />';
}
}
return $result;
}