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


PHP BackendUtility::getAjaxUrl方法代码示例

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


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

示例1: render

 /**
  * Handler for unknown types.
  *
  * @return array As defined in initializeResultArray() of AbstractNode
  */
 public function render()
 {
     $resultArray = $this->initializeResultArray();
     $languageService = $this->getLanguageService();
     $row = $this->data['databaseRow'];
     $parameterArray = $this->data['parameterArray'];
     // If ratios are set do not add default options
     if (isset($parameterArray['fieldConf']['config']['ratios'])) {
         unset($this->defaultConfig['ratios']);
     }
     $config = ArrayUtility::arrayMergeRecursiveOverrule($this->defaultConfig, $parameterArray['fieldConf']['config']);
     // By default we allow all image extensions that can be handled by the GFX functionality
     if ($config['allowedExtensions'] === null) {
         $config['allowedExtensions'] = $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'];
     }
     if ($config['readOnly']) {
         $options = array();
         $options['parameterArray'] = array('fieldConf' => array('config' => $config), 'itemFormElValue' => $parameterArray['itemFormElValue']);
         $options['renderType'] = 'none';
         return $this->nodeFactory->create($options)->render();
     }
     $file = $this->getFile($row, $config['file_field']);
     if (!$file) {
         return $resultArray;
     }
     $content = '';
     $preview = '';
     if (GeneralUtility::inList(mb_strtolower($config['allowedExtensions']), mb_strtolower($file->getExtension()))) {
         // Get preview
         $preview = $this->getPreview($file, $parameterArray['itemFormElValue']);
         // Check if ratio labels hold translation strings
         foreach ((array) $config['ratios'] as $ratio => $label) {
             $config['ratios'][$ratio] = $languageService->sL($label, true);
         }
         $formFieldId = StringUtility::getUniqueId('formengine-image-manipulation-');
         $wizardData = array('zoom' => $config['enableZoom'] ? '1' : '0', 'ratios' => json_encode($config['ratios']), 'file' => $file->getUid());
         $wizardData['token'] = GeneralUtility::hmac(implode('|', $wizardData), 'ImageManipulationWizard');
         $buttonAttributes = array('data-url' => BackendUtility::getAjaxUrl('wizard_image_manipulation', $wizardData), 'data-severity' => 'notice', 'data-image-name' => $file->getNameWithoutExtension(), 'data-image-uid' => $file->getUid(), 'data-file-field' => $config['file_field'], 'data-field' => $formFieldId);
         $button = '<button class="btn btn-default t3js-image-manipulation-trigger"';
         foreach ($buttonAttributes as $key => $value) {
             $button .= ' ' . $key . '="' . htmlspecialchars($value) . '"';
         }
         $button .= '><span class="t3-icon fa fa-crop"></span>';
         $button .= $languageService->sL('LLL:EXT:lang/locallang_wizards.xlf:imwizard.open-editor', true);
         $button .= '</button>';
         $inputField = '<input type="hidden" ' . 'id="' . $formFieldId . '" ' . 'name="' . $parameterArray['itemFormElName'] . '" ' . 'value="' . htmlspecialchars($parameterArray['itemFormElValue']) . '" />';
         $content .= $inputField . $button;
         $content .= $this->getImageManipulationInfoTable($parameterArray['itemFormElValue']);
         $resultArray['requireJsModules'][] = array('TYPO3/CMS/Backend/ImageManipulation' => 'function(ImageManipulation){ImageManipulation.initializeTrigger()}');
     }
     $content .= '<p class="text-muted"><em>' . $languageService->sL('LLL:EXT:lang/locallang_wizards.xlf:imwizard.supported-types-message', true) . '<br />';
     $content .= mb_strtoupper(implode(', ', GeneralUtility::trimExplode(',', $config['allowedExtensions'])));
     $content .= '</em></p>';
     $item = '<div class="media">';
     $item .= $preview;
     $item .= '<div class="media-body">' . $content . '</div>';
     $item .= '</div>';
     $resultArray['html'] = $item;
     return $resultArray;
 }
开发者ID:Gregpl,项目名称:TYPO3.CMS,代码行数:65,代码来源:ImageManipulationElement.php

示例2: manipulateCacheActions

 /**
  * Modifies CacheMenuItems array
  *
  * @param array $cacheActions
  * @param array $optionValues
  *
  * @return void
  */
 public function manipulateCacheActions(&$cacheActions, &$optionValues)
 {
     if ($this->isProduction() || !$this->isAdmin()) {
         return;
     }
     $cacheActions[] = ['id' => 'autoloader', 'title' => 'EXT:autoloader caches', 'href' => BackendUtility::getAjaxUrl('autoloader::clearCache'), 'icon' => '<img src="' . IconUtility::getByExtensionKey('autoloader') . '">'];
 }
开发者ID:Calius,项目名称:autoloader,代码行数:15,代码来源:ClearCache.php

示例3: buildJavascriptConfiguration

    /**
     * Return JS configuration of the htmlArea plugins registered by the extension
     *
     * @param 	integer		Relative id of the RTE editing area in the form
     * @return string		JS configuration for registered plugins
     */
    public function buildJavascriptConfiguration($RTEcounter)
    {
        $button = 'spellcheck';
        // Set the SpellChecker mode
        $spellCheckerMode = isset($GLOBALS['BE_USER']->userTS['options.']['HTMLAreaPspellMode']) ? trim($GLOBALS['BE_USER']->userTS['options.']['HTMLAreaPspellMode']) : 'normal';
        if (!in_array($spellCheckerMode, $this->spellCheckerModes)) {
            $spellCheckerMode = 'normal';
        }
        // Set the use of personal dictionary
        $enablePersonalDicts = $this->thisConfig['buttons.'][$button . '.']['enablePersonalDictionaries'] ? isset($GLOBALS['BE_USER']->userTS['options.']['enablePersonalDicts']) && $GLOBALS['BE_USER']->userTS['options.']['enablePersonalDicts'] ? TRUE : FALSE : FALSE;
        if ($this->htmlAreaRTE->is_FE()) {
            $enablePersonalDicts = FALSE;
        }
        $registerRTEinJavascriptString = '';
        if (in_array($button, $this->toolbar)) {
            if (!is_array($this->thisConfig['buttons.']) || !is_array($this->thisConfig['buttons.'][$button . '.'])) {
                $registerRTEinJavascriptString .= '
			RTEarea[' . $RTEcounter . '].buttons.' . $button . ' = new Object();';
            }
            $registerRTEinJavascriptString .= '
			RTEarea[' . $RTEcounter . '].buttons.' . $button . '.contentTypo3Language = "' . $this->htmlAreaRTE->contentTypo3Language . '";
			RTEarea[' . $RTEcounter . '].buttons.' . $button . '.contentISOLanguage = "' . $this->htmlAreaRTE->contentISOLanguage . '";
			RTEarea[' . $RTEcounter . '].buttons.' . $button . '.contentCharset = "' . $this->htmlAreaRTE->contentCharset . '";
			RTEarea[' . $RTEcounter . '].buttons.' . $button . '.spellCheckerMode = "' . $spellCheckerMode . '";
			RTEarea[' . $RTEcounter . '].buttons.' . $button . '.enablePersonalDicts = ' . ($enablePersonalDicts ? 'true' : 'false') . ';';
            $registerRTEinJavascriptString .= '
			RTEarea[' . $RTEcounter . '].buttons.' . $button . '.path = "' . ($this->htmlAreaRTE->is_FE() || $this->htmlAreaRTE->isFrontendEditActive() ? ($GLOBALS['TSFE']->absRefPrefix ? $GLOBALS['TSFE']->absRefPrefix : '') . 'index.php?eID=rtehtmlarea_spellchecker' : $this->htmlAreaRTE->backPath . BackendUtility::getAjaxUrl('rtehtmlarea::spellchecker')) . '";';
        }
        return $registerRTEinJavascriptString;
    }
开发者ID:khanhdeux,项目名称:typo3test,代码行数:36,代码来源:Spellchecker.php

示例4: generatePublicUrl

 /**
  * Generate public url for file
  *
  * @param Resource\ResourceStorage $storage
  * @param Resource\Driver\DriverInterface $driver
  * @param Resource\FileInterface $file
  * @param $relativeToCurrentScript
  * @param array $urlData
  * @return void
  */
 public function generatePublicUrl(Resource\ResourceStorage $storage, Resource\Driver\DriverInterface $driver, Resource\FileInterface $file, $relativeToCurrentScript, array $urlData)
 {
     // We only render special links for non-public files
     if ($this->enabled && !$storage->isPublic()) {
         $queryParameterArray = array('eID' => 'dumpFile', 't' => '');
         if ($file instanceof Resource\File) {
             $queryParameterArray['f'] = $file->getUid();
             $queryParameterArray['t'] = 'f';
         } elseif ($file instanceof Resource\ProcessedFile) {
             $queryParameterArray['p'] = $file->getUid();
             $queryParameterArray['t'] = 'p';
         }
         $queryParameterArray['token'] = GeneralUtility::hmac(implode('|', $queryParameterArray), 'BeResourceStorageDumpFile');
         // $urlData['publicUrl'] is passed by reference, so we can change that here and the value will be taken into account
         $urlData['publicUrl'] = BackendUtility::getAjaxUrl('FalSecuredownload::publicUrl', $queryParameterArray);
     }
 }
开发者ID:camrun91,项目名称:fal_securedownload,代码行数:27,代码来源:PublicUrlAspect.php

示例5: buildJavascriptConfiguration

 /**
  * Return JS configuration of the htmlArea plugins registered by the extension
  *
  * @return string JS configuration for registered plugins
  */
 public function buildJavascriptConfiguration()
 {
     $jsArray = array();
     $button = 'spellcheck';
     // Set the SpellChecker mode
     $spellCheckerMode = isset($GLOBALS['BE_USER']->userTS['options.']['HTMLAreaPspellMode']) ? trim($GLOBALS['BE_USER']->userTS['options.']['HTMLAreaPspellMode']) : 'normal';
     if (!in_array($spellCheckerMode, $this->spellCheckerModes)) {
         $spellCheckerMode = 'normal';
     }
     // Set the use of personal dictionary
     $enablePersonalDicts = $this->configuration['thisConfig']['buttons.'][$button . '.']['enablePersonalDictionaries'] && !empty($GLOBALS['BE_USER']->userTS['options.']['enablePersonalDicts']);
     if (in_array($button, $this->toolbar)) {
         if (!is_array($this->configuration['thisConfig']['buttons.']) || !is_array($this->configuration['thisConfig']['buttons.'][$button . '.'])) {
             $jsArray[] = 'RTEarea[editornumber].buttons.' . $button . ' = new Object();';
         }
         $jsArray[] = 'RTEarea[editornumber].buttons.' . $button . '.contentTypo3Language = "' . $this->configuration['contentTypo3Language'] . '";';
         $jsArray[] = 'RTEarea[editornumber].buttons.' . $button . '.contentISOLanguage = "' . $this->configuration['contentISOLanguage'] . '";';
         $jsArray[] = 'RTEarea[editornumber].buttons.' . $button . '.spellCheckerMode = "' . $spellCheckerMode . '";';
         $jsArray[] = 'RTEarea[editornumber].buttons.' . $button . '.enablePersonalDicts = ' . ($enablePersonalDicts ? 'true' : 'false') . ';';
         $jsArray[] = 'RTEarea[editornumber].buttons.' . $button . '.path = "' . ($this->isFrontend() || $this->isFrontendEditActive() ? ($GLOBALS['TSFE']->absRefPrefix ? $GLOBALS['TSFE']->absRefPrefix : '') . 'index.php?eID=rtehtmlarea_spellchecker' : BackendUtility::getAjaxUrl('rtehtmlarea::spellchecker')) . '";';
     }
     return implode(LF, $jsArray);
 }
开发者ID:plan2net,项目名称:TYPO3.CMS,代码行数:28,代码来源:Spellchecker.php

示例6: addAjaxUrlsToInlineSettings

 /**
  * Make URLs to all backend ajax handlers available as inline setting.
  */
 protected function addAjaxUrlsToInlineSettings()
 {
     $ajaxUrls = array();
     foreach (array_keys($GLOBALS['TYPO3_CONF_VARS']['BE']['AJAX']) as $ajaxHandler) {
         $ajaxUrls[$ajaxHandler] = BackendUtility::getAjaxUrl($ajaxHandler);
     }
     $this->inlineSettings['ajaxUrls'] = $ajaxUrls;
 }
开发者ID:samuweiss,项目名称:TYPO3-Site,代码行数:11,代码来源:PageRenderer.php

示例7: manipulateCacheActions

 /**
  * Adds a menu entry to the clear cache menu to detect Solr connections.
  *
  * @param array $cacheActions Array of CacheMenuItems
  * @param array $optionValues Array of AccessConfigurations-identifiers (typically  used by userTS with options.clearCache.identifier)
  */
 public function manipulateCacheActions(&$cacheActions, &$optionValues)
 {
     if ($GLOBALS['BE_USER']->isAdmin()) {
         $title = 'Initialize Solr connections';
         $cacheActions[] = array('id' => 'clearSolrConnectionCache', 'title' => $title, 'href' => BackendUtility::getAjaxUrl('solr::clearSolrConnectionCache'), 'icon' => IconUtility::getSpriteIcon('extensions-solr-InitSolrConnections'));
         $optionValues[] = 'clearSolrConnectionCache';
     }
 }
开发者ID:Gregor-Agnes,项目名称:ext-solr,代码行数:14,代码来源:ConnectionManager.php

示例8: manipulateCacheActions

 /**
  * Adds a menu entry to the clear cache menu to detect Solr connections.
  *
  * @param array $cacheActions Array of CacheMenuItems
  * @param array $optionValues Array of AccessConfigurations-identifiers (typically  used by userTS with options.clearCache.identifier)
  */
 public function manipulateCacheActions(&$cacheActions, &$optionValues)
 {
     if ($GLOBALS['BE_USER']->isAdmin()) {
         $title = 'Initialize Solr connections';
         $iconFactory = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Imaging\\IconFactory');
         $cacheActions[] = array('id' => 'clearSolrConnectionCache', 'title' => $title, 'href' => BackendUtility::getAjaxUrl('solr::clearSolrConnectionCache'), 'icon' => $iconFactory->getIcon('extensions-solr-module-initsolrconnections', Icon::SIZE_SMALL));
         $optionValues[] = 'clearSolrConnectionCache';
     }
 }
开发者ID:hnadler,项目名称:ext-solr,代码行数:15,代码来源:ConnectionManager.php

示例9: getRoutingUrl

 /**
  * Returns the convenient path for the routing Urls based on the TYPO3 mode.
  *
  * @param string $namespace
  * @return string
  */
 public function getRoutingUrl($namespace)
 {
     if (TYPO3_MODE === 'FE') {
         $url = GeneralUtility::locationHeaderUrl('?eID=ExtDirect&action=route&namespace=' . rawurlencode($namespace));
     } else {
         $url = BackendUtility::getAjaxUrl('ext_direct_route', array('namespace' => $namespace));
     }
     return $url;
 }
开发者ID:rickymathew,项目名称:TYPO3.CMS,代码行数:15,代码来源:ExtDirectApi.php

示例10: manipulateCacheActions

 /**
  * Add new cache menu option.
  *
  * @param  array $cacheActions
  * @param  array $optionValues
  * @return void
  */
 public function manipulateCacheActions(&$cacheActions, &$optionValues)
 {
     $cacheActions[] = array('id' => 'tev_cache_url', 'title' => 'Flush RealURL config', 'href' => BackendUtility::getAjaxUrl('TevTevAjax::clearRealurlConfig'), 'icon' => IconUtility::getSpriteIcon('actions-system-cache-clear-impact-low'));
     $optionValues[] = 'clearCacheTevUrl';
 }
开发者ID:3ev,项目名称:tev,代码行数:12,代码来源:CacheMenu.php


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