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


PHP PageRenderer::loadRequireJsModule方法代码示例

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


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

示例1: render

 /**
  * Load RequireJS code.
  *
  * @return void
  * @api
  */
 public function render()
 {
     $content = $this->renderChildren();
     $this->pageRenderer->addJsInlineCode('vidi-inline', $content);
     $configuration['paths']['Fab/Vidi'] = '../typo3conf/ext/vidi/Resources/Public/JavaScript';
     $this->pageRenderer->addRequireJsConfiguration($configuration);
     $this->pageRenderer->loadRequireJsModule('Fab/Vidi/Vidi/Main');
 }
开发者ID:BergischMedia,项目名称:vidi,代码行数:14,代码来源:RequireJsViewHelper.php

示例2: __construct

 /**
  * Construct
  */
 public function __construct()
 {
     $this->doc = GeneralUtility::makeInstance(DocumentTemplate::class);
     $this->iconFactory = GeneralUtility::makeInstance(IconFactory::class);
     $this->pageRenderer = GeneralUtility::makeInstance(PageRenderer::class);
     $this->pageRenderer->loadJquery();
     $this->pageRenderer->loadRequireJsModule('TYPO3/CMS/Recordlist/ElementBrowser');
     $this->initialize();
 }
开发者ID:rickymathew,项目名称:TYPO3.CMS,代码行数:12,代码来源:AbstractElementBrowser.php

示例3: addJSCSS

 /**
  * wrapper function called by hook (\TYPO3\CMS\Core\Page\PageRenderer->render-preProcess)
  *
  * @param array $parameters : An array of available parameters
  * @param \TYPO3\CMS\Core\Page\PageRenderer $pageRenderer : The parent object that triggered this hook
  *
  * @return void
  */
 public function addJSCSS($parameters, &$pageRenderer)
 {
     // Add javascript
     $pageRenderer->loadRequireJsModule('TYPO3/CMS/Themes/ThemesBackendTca');
     // Add css
     $filename = $pageRenderer->backPath . ExtensionManagementUtility::extRelPath('themes') . 'Resources/Public/Stylesheet/ThemesBackendTca.css';
     $pageRenderer->addCssFile($filename, 'stylesheet', 'screen');
 }
开发者ID:dkd,项目名称:themes,代码行数:16,代码来源:PageRenderer.php

示例4: getDynamicTabMenu

 /**
  * Creates a tab menu where the tabs or collapsible are rendered with bootstrap markup
  *
  * @param array $menuItems Tab elements, each element is an array with "label" and "content"
  * @param string $domId DOM id attribute, will be appended with an iteration number per tab.
  * @param int $defaultTabIndex Default tab to open (for toggle <=0). Value corresponds to integer-array index + 1
  *                             (index zero is "1", index "1" is 2 etc.). A value of zero (or something non-existing
  *                             will result in no default tab open.
  * @param bool $collapsible If set, the tabs are rendered as headers instead over each sheet. Effectively this means
  *                          there is no tab menu, but rather a foldout/fold-in menu.
  * @param bool $wrapContent If set, the content is wrapped in div structure which provides a padding and border
  *                          style. Set this FALSE to get unstyled content pane with fullsize content area.
  * @param bool $storeLastActiveTab If set, the last open tab is stored in local storage and will be re-open again.
  *                                 If you don't need this feature, e.g. for wizards like import/export you can
  *                                 disable this behaviour.
  * @return string
  */
 public function getDynamicTabMenu(array $menuItems, $domId, $defaultTabIndex = 1, $collapsible = false, $wrapContent = true, $storeLastActiveTab = true)
 {
     $this->pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/Tabs');
     $templatePathAndFileName = 'EXT:backend/Resources/Private/Templates/DocumentTemplate/' . ($collapsible ? 'Collapse.html' : 'Tabs.html');
     $view = GeneralUtility::makeInstance(StandaloneView::class);
     $view->setTemplatePathAndFilename(GeneralUtility::getFileAbsFileName($templatePathAndFileName));
     $view->assignMultiple(array('id' => 'DTM-' . GeneralUtility::shortMD5($domId), 'items' => $menuItems, 'defaultTabIndex' => $defaultTabIndex, 'wrapContent' => $wrapContent, 'storeLastActiveTab' => $storeLastActiveTab));
     return $view->render();
 }
开发者ID:Gregpl,项目名称:TYPO3.CMS,代码行数:26,代码来源:ModuleTemplate.php

示例5: render

 /**
  * @param StandaloneView $view
  * @param PageRenderer $pageRenderer
  * @param LoginController $loginController
  * @throws \UnexpectedValueException
  */
 public function render(StandaloneView $view, PageRenderer $pageRenderer, LoginController $loginController)
 {
     GeneralUtility::makeInstance(ObjectManager::class)->get(Dispatcher::class)->dispatch(__CLASS__, self::SIGNAL_getPageRenderer, array($pageRenderer));
     $pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/UserPassLogin');
     $view->setTemplatePathAndFilename(GeneralUtility::getFileAbsFileName('EXT:backend/Resources/Private/Templates/UserPassLoginForm.html'));
     if (GeneralUtility::getIndpEnv('TYPO3_SSL')) {
         $view->assign('presetUsername', GeneralUtility::_GP('u'));
         $view->assign('presetPassword', GeneralUtility::_GP('p'));
     }
 }
开发者ID:rickymathew,项目名称:TYPO3.CMS,代码行数:16,代码来源:UsernamePasswordLoginProvider.php

示例6: getPageRenderer

 /**
  * @param PageRenderer $pageRenderer
  */
 public function getPageRenderer(PageRenderer $pageRenderer)
 {
     $loginSecurityLevel = trim($GLOBALS['TYPO3_CONF_VARS']['BE']['loginSecurityLevel']) ?: 'normal';
     if ($loginSecurityLevel === 'rsa') {
         $javascriptPath = '../' . ExtensionManagementUtility::siteRelPath('rsaauth') . 'Resources/Public/JavaScript/';
         $files = array('jsbn/jsbn.js', 'jsbn/prng4.js', 'jsbn/rng.js', 'jsbn/rsa.js', 'jsbn/base64.js');
         foreach ($files as $file) {
             $pageRenderer->addJsFile($javascriptPath . $file);
         }
         $pageRenderer->loadRequireJsModule('TYPO3/CMS/Rsaauth/BackendLoginFormRsaEncryption');
     }
 }
开发者ID:plan2net,项目名称:TYPO3.CMS,代码行数:15,代码来源:UsernamePasswordProviderSlot.php

示例7: __construct

    /**
     * Constructor
     */
    public function __construct()
    {
        $this->getLanguageService()->includeLLFile('EXT:lang/locallang_misc.xlf');
        $this->backendModuleRepository = GeneralUtility::makeInstance(BackendModuleRepository::class);
        // Set debug flag for BE development only
        $this->debug = (int) $GLOBALS['TYPO3_CONF_VARS']['BE']['debug'] === 1;
        // Initializes the backend modules structure for use later.
        $this->moduleLoader = GeneralUtility::makeInstance(ModuleLoader::class);
        $this->moduleLoader->load($GLOBALS['TBE_MODULES']);
        $this->pageRenderer = GeneralUtility::makeInstance(PageRenderer::class);
        $this->pageRenderer->loadExtJS();
        // included for the module menu JavaScript, please note that this is subject to change
        $this->pageRenderer->loadJquery();
        $this->pageRenderer->addJsInlineCode('consoleOverrideWithDebugPanel', '//already done', false);
        $this->pageRenderer->addExtDirectCode();
        // Add default BE javascript
        $backendRelPath = ExtensionManagementUtility::extRelPath('backend');
        $this->jsFiles = array('locallang' => $this->getLocalLangFileName(), 'md5' => $backendRelPath . 'Resources/Public/JavaScript/md5.js', 'modulemenu' => $backendRelPath . 'Resources/Public/JavaScript/modulemenu.js', 'evalfield' => $backendRelPath . 'Resources/Public/JavaScript/jsfunc.evalfield.js', 'notifications' => $backendRelPath . 'Resources/Public/JavaScript/notifications.js', 'backend' => $backendRelPath . 'Resources/Public/JavaScript/backend.js', 'viewport' => $backendRelPath . 'Resources/Public/JavaScript/extjs/viewport.js', 'iframepanel' => $backendRelPath . 'Resources/Public/JavaScript/iframepanel.js', 'backendcontentiframe' => $backendRelPath . 'Resources/Public/JavaScript/extjs/backendcontentiframe.js', 'viewportConfiguration' => $backendRelPath . 'Resources/Public/JavaScript/extjs/viewportConfiguration.js');
        $this->pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/LoginRefresh', 'function(LoginRefresh) {
			LoginRefresh.setLoginFramesetUrl(' . GeneralUtility::quoteJSvalue(BackendUtility::getModuleUrl('login_frameset')) . ');
			LoginRefresh.setLogoutUrl(' . GeneralUtility::quoteJSvalue(BackendUtility::getModuleUrl('logout')) . ');
		}');
        // load Utility class
        $this->pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/Utility');
        // load Notification functionality
        $this->pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/Notification');
        // load Modals
        $this->pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/Modal');
        // load Legacy CSS Support
        $this->pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/LegacyCssClasses');
        // load the storage API and fill the UC into the PersistentStorage, so no additional AJAX call is needed
        $this->pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/Storage', 'function(Storage) {
			Storage.Persistent.load(' . json_encode($this->getBackendUser()->uc) . ');
		}');
        // load debug console
        $this->pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/DebugConsole');
        // Load RSA encryption
        $rsaEncryptionEncoder = GeneralUtility::makeInstance(RsaEncryptionEncoder::class);
        $rsaEncryptionEncoder->enableRsaEncryption(true);
        $this->pageRenderer->addInlineSetting('ShowItem', 'moduleUrl', BackendUtility::getModuleUrl('show_item'));
        $this->css = '';
        $this->initializeToolbarItems();
        if (isset($GLOBALS['TBE_STYLES']['dims']['leftMenuFrameW'])) {
            $this->menuWidth = (int) $GLOBALS['TBE_STYLES']['dims']['leftMenuFrameW'];
        }
        $this->executeHook('constructPostProcess');
        $this->includeLegacyBackendItems();
    }
开发者ID:burguin,项目名称:test01,代码行数:51,代码来源:BackendController.php

示例8: render

 /**
  * Render start page with \TYPO3\CMS\Backend\Template\DocumentTemplate and pageTitle
  *
  * @param string $pageTitle title tag of the module. Not required by default, as BE modules are shown in a frame
  * @param bool $loadExtJs specifies whether to load ExtJS library. Defaults to FALSE
  * @param bool $loadExtJsTheme whether to load ExtJS "grey" theme. Defaults to FALSE
  * @param bool $enableExtJsDebug if TRUE, debug version of ExtJS is loaded. Use this for development only
  * @param bool $loadJQuery whether to load jQuery library. Defaults to FALSE
  * @param array $includeCssFiles List of custom CSS file to be loaded
  * @param array $includeJsFiles List of custom JavaScript file to be loaded
  * @param array $addJsInlineLabels Custom labels to add to JavaScript inline labels
  * @param array $includeRequireJsModules List of RequireJS modules to be loaded
  * @param string $jQueryNamespace Store the jQuery object in a specific namespace
  * @return void
  */
 public function render($pageTitle = '', $loadExtJs = false, $loadExtJsTheme = true, $enableExtJsDebug = false, $loadJQuery = false, $includeCssFiles = null, $includeJsFiles = null, $addJsInlineLabels = null, $includeRequireJsModules = null, $jQueryNamespace = null)
 {
     if ($pageTitle) {
         $this->pageRenderer->setTitle($pageTitle);
     }
     if ($loadExtJs) {
         $this->pageRenderer->loadExtJS(true, $loadExtJsTheme);
         if ($enableExtJsDebug) {
             $this->pageRenderer->enableExtJsDebug();
         }
     }
     if ($loadJQuery) {
         $jQueryNamespace = $jQueryNamespace ?: PageRenderer::JQUERY_NAMESPACE_DEFAULT;
         $this->pageRenderer->loadJquery(null, null, $jQueryNamespace);
     }
     // Include custom CSS and JS files
     if (is_array($includeCssFiles) && count($includeCssFiles) > 0) {
         foreach ($includeCssFiles as $addCssFile) {
             $this->pageRenderer->addCssFile($addCssFile);
         }
     }
     if (is_array($includeJsFiles) && count($includeJsFiles) > 0) {
         foreach ($includeJsFiles as $addJsFile) {
             $this->pageRenderer->addJsFile($addJsFile);
         }
     }
     if (is_array($includeRequireJsModules) && count($includeRequireJsModules) > 0) {
         foreach ($includeRequireJsModules as $addRequireJsFile) {
             $this->pageRenderer->loadRequireJsModule($addRequireJsFile);
         }
     }
     // Add inline language labels
     if (is_array($addJsInlineLabels) && count($addJsInlineLabels) > 0) {
         $extensionKey = $this->controllerContext->getRequest()->getControllerExtensionKey();
         foreach ($addJsInlineLabels as $key) {
             $label = LocalizationUtility::translate($key, $extensionKey);
             $this->pageRenderer->addInlineLanguageLabel($key, $label);
         }
     }
 }
开发者ID:rickymathew,项目名称:TYPO3.CMS,代码行数:55,代码来源:PageRendererViewHelper.php

示例9: listTasksAction

    /**
     * Assemble display of list of scheduled tasks
     *
     * @return string Table of pending tasks
     */
    protected function listTasksAction()
    {
        $this->view->setTemplatePathAndFilename($this->backendTemplatePath . 'ListTasks.html');
        // Define display format for dates
        $dateFormat = $GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'] . ' ' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['hhmm'];
        // Get list of registered classes
        $registeredClasses = $this->getRegisteredClasses();
        // Get list of registered task groups
        $registeredTaskGroups = $this->getRegisteredTaskGroups();
        // add an empty entry for non-grouped tasks
        // add in front of list
        array_unshift($registeredTaskGroups, array('uid' => 0, 'groupName' => ''));
        // Get all registered tasks
        // Just to get the number of entries
        $query = array('SELECT' => '
				tx_scheduler_task.*,
				tx_scheduler_task_group.groupName as taskGroupName,
				tx_scheduler_task_group.description as taskGroupDescription,
				tx_scheduler_task_group.deleted as isTaskGroupDeleted
				', 'FROM' => '
				tx_scheduler_task
				LEFT JOIN tx_scheduler_task_group ON tx_scheduler_task_group.uid = tx_scheduler_task.task_group
				', 'WHERE' => '1=1', 'ORDERBY' => 'tx_scheduler_task_group.sorting');
        $res = $this->getDatabaseConnection()->exec_SELECT_queryArray($query);
        $numRows = $this->getDatabaseConnection()->sql_num_rows($res);
        // No tasks defined, display information message
        if ($numRows == 0) {
            $this->view->setTemplatePathAndFilename($this->backendTemplatePath . 'ListTasksNoTasks.html');
            return $this->view->render();
        } else {
            $this->pageRenderer->loadJquery();
            $this->pageRenderer->loadRequireJsModule('TYPO3/CMS/Scheduler/Scheduler');
            $table = array();
            // Header row
            $table[] = '<thead><tr>' . '<th><a href="#" id="checkall" title="' . $this->getLanguageService()->getLL('label.checkAll', TRUE) . '" class="icon">' . IconUtility::getSpriteIcon('actions-document-select') . '</a></th>' . '<th>' . $this->getLanguageService()->getLL('label.id', TRUE) . '</th>' . '<th>' . $this->getLanguageService()->getLL('task', TRUE) . '</th>' . '<th>' . $this->getLanguageService()->getLL('label.type', TRUE) . '</th>' . '<th>' . $this->getLanguageService()->getLL('label.frequency', TRUE) . '</th>' . '<th>' . $this->getLanguageService()->getLL('label.parallel', TRUE) . '</th>' . '<th>' . $this->getLanguageService()->getLL('label.lastExecution', TRUE) . '</th>' . '<th>' . $this->getLanguageService()->getLL('label.nextExecution', TRUE) . '</th>' . '<th></th>' . '</tr></thead>';
            // Loop on all tasks
            $temporaryResult = array();
            while ($row = $this->getDatabaseConnection()->sql_fetch_assoc($res)) {
                if ($row['taskGroupName'] === NULL || $row['isTaskGroupDeleted'] === '1') {
                    $row['taskGroupName'] = '';
                    $row['taskGroupDescription'] = '';
                    $row['task_group'] = 0;
                }
                $temporaryResult[$row['task_group']]['groupName'] = $row['taskGroupName'];
                $temporaryResult[$row['task_group']]['groupDescription'] = $row['taskGroupDescription'];
                $temporaryResult[$row['task_group']]['tasks'][] = $row;
            }
            foreach ($temporaryResult as $taskGroup) {
                if (!empty($taskGroup['groupName'])) {
                    $groupText = '<strong>' . htmlspecialchars($taskGroup['groupName']) . '</strong>';
                    if (!empty($taskGroup['groupDescription'])) {
                        $groupText .= '<br>' . nl2br(htmlspecialchars($taskGroup['groupDescription']));
                    }
                    $table[] = '<tr><td colspan="9">' . $groupText . '</td></tr>';
                }
                foreach ($taskGroup['tasks'] as $schedulerRecord) {
                    // Define action icons
                    $editAction = '<a class="btn btn-default" href="' . htmlspecialchars($this->moduleUri . '&CMD=edit&tx_scheduler[uid]=' . $schedulerRecord['uid']) . '" title="' . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_common.xlf:edit', TRUE) . '" class="icon">' . IconUtility::getSpriteIcon('actions-document-open') . '</a>';
                    if ((int) $schedulerRecord['disable'] === 1) {
                        $translationKey = 'enable';
                        $spriteIcon = 'actions-edit-unhide';
                    } else {
                        $translationKey = 'disable';
                        $spriteIcon = 'actions-edit-hide';
                    }
                    $toggleHiddenAction = '<a class="btn btn-default" href="' . htmlspecialchars($this->moduleUri . '&CMD=toggleHidden&tx_scheduler[uid]=' . $schedulerRecord['uid']) . '" title="' . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_common.xlf:' . $translationKey, TRUE) . '" class="icon">' . IconUtility::getSpriteIcon($spriteIcon) . '</a>';
                    $deleteAction = '<a class="btn btn-default" href="' . htmlspecialchars($this->moduleUri . '&CMD=delete&tx_scheduler[uid]=' . $schedulerRecord['uid']) . '" onclick="return confirm(' . GeneralUtility::quoteJSvalue($this->getLanguageService()->getLL('msg.delete')) . ');" title="' . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_common.xlf:delete', TRUE) . '" class="icon">' . IconUtility::getSpriteIcon('actions-edit-delete') . '</a>';
                    $stopAction = '<a class="btn btn-default" href="' . htmlspecialchars($this->moduleUri . '&CMD=stop&tx_scheduler[uid]=' . $schedulerRecord['uid']) . '" onclick="return confirm(' . GeneralUtility::quoteJSvalue($this->getLanguageService()->getLL('msg.stop')) . ');" title="' . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_common.xlf:stop', TRUE) . '" class="icon">' . IconUtility::getSpriteIcon('actions-document-close') . '</a>';
                    $runAction = '<a class="btn btn-default" href="' . htmlspecialchars($this->moduleUri . '&tx_scheduler[execute][]=' . $schedulerRecord['uid']) . '" title="' . $this->getLanguageService()->getLL('action.run_task', TRUE) . '" class="icon">' . IconUtility::getSpriteIcon('extensions-scheduler-run-task') . '</a>';
                    // Define some default values
                    $lastExecution = '-';
                    $isRunning = FALSE;
                    $showAsDisabled = FALSE;
                    $startExecutionElement = '<span class="btn btn-default disabled">' . IconUtility::getSpriteIcon('empty-empty') . '</span>';
                    // Restore the serialized task and pass it a reference to the scheduler object
                    /** @var $task \TYPO3\CMS\Scheduler\Task\AbstractTask|\TYPO3\CMS\Scheduler\ProgressProviderInterface */
                    $task = unserialize($schedulerRecord['serialized_task_object']);
                    $class = get_class($task);
                    if ($class === '__PHP_Incomplete_Class' && preg_match('/^O:[0-9]+:"(?P<classname>.+?)"/', $schedulerRecord['serialized_task_object'], $matches) === 1) {
                        $class = $matches['classname'];
                    }
                    // Assemble information about last execution
                    if (!empty($schedulerRecord['lastexecution_time'])) {
                        $lastExecution = date($dateFormat, $schedulerRecord['lastexecution_time']);
                        if ($schedulerRecord['lastexecution_context'] == 'CLI') {
                            $context = $this->getLanguageService()->getLL('label.cron');
                        } else {
                            $context = $this->getLanguageService()->getLL('label.manual');
                        }
                        $lastExecution .= ' (' . $context . ')';
                    }
                    if ($this->scheduler->isValidTaskObject($task)) {
                        // The task object is valid
                        $labels = array();
                        $name = htmlspecialchars($registeredClasses[$class]['title'] . ' (' . $registeredClasses[$class]['extension'] . ')');
//.........这里部分代码省略.........
开发者ID:adrolli,项目名称:TYPO3.CMS,代码行数:101,代码来源:SchedulerModuleController.php

示例10: getDragDropCode

    /**
     * Includes the necessary javascript file for use on pages which have the
     * drag and drop functionality (legacy folder tree)
     *
     * @param string $table indicator of which table the drag and drop function should work on (pages or folders)
     * @param string $additionalJavaScriptCode adds more code to the additional javascript code
     * @return void
     * @deprecated since TYPO3 CMS 8, will be removed in TYPO3 CMS 9.
     */
    public function getDragDropCode($table, $additionalJavaScriptCode = '')
    {
        GeneralUtility::logDeprecatedFunction();
        $this->pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/LegacyTree', 'function() {
			DragDrop.table = "' . $table . '";
			' . $additionalJavaScriptCode . '
		}');
    }
开发者ID:amazingh,项目名称:TYPO3.CMS,代码行数:17,代码来源:DocumentTemplate.php

示例11: addJSCSS

 /**
  * wrapper function called by hook (\TYPO3\CMS\Core\Page\PageRenderer->render-preProcess)
  *
  * @param array $parameters : An array of available parameters
  * @param \TYPO3\CMS\Core\Page\PageRenderer $pageRenderer : The parent object that triggered this hook
  *
  * @return void
  */
 public function addJSCSS($parameters, &$pageRenderer)
 {
     if (get_class($GLOBALS['SOBE']) === 'TYPO3\\CMS\\Recordlist\\RecordList') {
         $pageRenderer->loadRequireJsModule('TYPO3/CMS/Gridelements/GridElementsOnReady');
         return;
     }
     if (get_class($GLOBALS['SOBE']) === 'TYPO3\\CMS\\Backend\\Controller\\PageLayoutController') {
         $iconFactory = GeneralUtility::makeInstance(IconFactory::class);
         $pageRenderer->loadRequireJsModule('TYPO3/CMS/Gridelements/GridElementsOnReady');
         $pageRenderer->loadRequireJsModule('TYPO3/CMS/Gridelements/GridElementsDragDrop');
         $pageRenderer->loadRequireJsModule('TYPO3/CMS/Gridelements/GridElementsDragInWizard');
         /** @var Clipboard $clipObj */
         $clipObj = GeneralUtility::makeInstance(Clipboard::class);
         // Start clipboard
         $clipObj->initializeClipboard();
         $clipObj->lockToNormal();
         if (!$pageRenderer->getCharSet()) {
             $pageRenderer->setCharSet($GLOBALS['LANG']->charSet ? $GLOBALS['LANG']->charSet : 'utf-8');
         }
         // pull locallang_db.xml to JS side - only the tx_gridelements_js-prefixed keys
         $pageRenderer->addInlineLanguageLabelFile('EXT:gridelements/Resources/Private/Language/locallang_db.xml', 'tx_gridelements_js');
         $pAddExtOnReadyCode = '
             TYPO3.l10n = {
                 localize: function(langKey){
                     return TYPO3.lang[langKey];
                 }
             }
         ';
         $allowedContentTypesClassesByColPos = array();
         $allowedGridTypesClassesByColPos = array();
         $layoutSetup = GeneralUtility::callUserFunction('TYPO3\\CMS\\Backend\\View\\BackendLayoutView->getSelectedBackendLayout', intval(GeneralUtility::_GP('id')), $this);
         if (is_array($layoutSetup) && !empty($layoutSetup['__config']['backend_layout.']['rows.'])) {
             foreach ($layoutSetup['__config']['backend_layout.']['rows.'] as $rows) {
                 foreach ($rows as $row) {
                     if (!empty($layoutSetup['__config']['backend_layout.']['rows.'])) {
                         foreach ($row as $col) {
                             $classes = '';
                             $gridClasses = '';
                             if ($col['allowed']) {
                                 $allowed = explode(',', $col['allowed']);
                                 foreach ($allowed as $contentTypes) {
                                     $contentTypes = trim($contentTypes);
                                     if ($contentTypes === '*') {
                                         $classes = 't3-allow-all';
                                         break;
                                     } else {
                                         $contentTypes = explode(',', $contentTypes);
                                         foreach ($contentTypes as $contentType) {
                                             $classes .= 't3-allow-' . $contentType . ' ';
                                         }
                                     }
                                 }
                             } else {
                                 $classes = 't3-allow-all';
                             }
                             if ($col['allowedGridTypes']) {
                                 $allowedGridTypes = explode(',', $col['allowedGridTypes']);
                                 $classes .= 't3-allow-gridelements_pi1 ';
                                 foreach ($allowedGridTypes as $gridTypes) {
                                     $gridTypes = trim($gridTypes);
                                     if ($gridTypes !== '*') {
                                         $gridTypes = explode(',', $gridTypes);
                                         foreach ($gridTypes as $gridType) {
                                             $gridClasses .= 't3-allow-gridtype t3-allow-gridtype-' . $gridType . ' ';
                                         }
                                     }
                                 }
                                 if ($classes !== 't3-allow-all') {
                                     $classes .= 't3-allow-gridelements_pi1 ';
                                 }
                             }
                             $allowedContentTypesClassesByColPos[$col['colPos']] .= ' ' . trim($classes);
                             $allowedGridTypesClassesByColPos[$col['colPos']] .= ' ' . trim($gridClasses);
                         }
                     }
                 }
             }
         }
         // add Ext.onReady() code from file
         $pAddExtOnReadyCode .= "\n            top.pageColumnsAllowedCTypes = " . json_encode($allowedContentTypesClassesByColPos) . ";\n            top.pageColumnsAllowedGridTypes = " . json_encode($allowedGridTypesClassesByColPos) . ";\n            top.pasteReferenceAllowed = " . ($this->getBackendUser()->checkAuthMode('tt_content', 'CType', 'shortcut', 'explicitAllow') ? 'true' : 'false') . ";\n            top.skipDraggableDetails = " . ($this->getBackendUser()->uc['dragAndDropHideNewElementWizardInfoOverlay'] ? 'true' : 'false') . ";\n            top.backPath = '" . $GLOBALS['BACK_PATH'] . "';\n            top.browserUrl = '" . BackendUtility::getModuleUrl('wizard_element_browser') . "'";
         $elFromTable = $clipObj->elFromTable('tt_content');
         if (!empty($elFromTable)) {
             $pasteItem = substr(key($elFromTable), 11);
             $pasteRecord = BackendUtility::getRecord('tt_content', (int) $pasteItem);
             $pasteTitle = $pasteRecord['header'] ? $pasteRecord['header'] : $pasteItem;
             $copyMode = $clipObj->clipData['normal']['mode'] ? '-' . $clipObj->clipData['normal']['mode'] : '';
             $pAddExtOnReadyCode .= "\n                    top.pasteIntoLinkTemplate = " . json_encode('<a data-pasteitem="' . $pasteItem . '" data-pastetitle="' . $pasteTitle . '" class="t3js-paste t3js-paste' . $copyMode . ' t3js-paste-into btn btn-default" title="' . $this->getLanguageService()->sL('LLL:EXT:gridelements/Resources/Private/Language/locallang_db.xml:tx_gridelements_js.pasteinto') . '">' . $iconFactory->getIcon('actions-document-paste-into', Icon::SIZE_SMALL)->render() . '</a>') . ";\n                    top.pasteAfterLinkTemplate = " . json_encode('<a data-pasteitem="' . $pasteItem . '" data-pastetitle="' . $pasteTitle . '"  class="t3js-paste t3js-paste' . $copyMode . ' t3js-paste-after btn btn-default" title="' . $this->getLanguageService()->sL('LLL:EXT:gridelements/Resources/Private/Language/locallang_db.xml:tx_gridelements_js.pasteafter') . '">' . $iconFactory->getIcon('actions-document-paste-into', Icon::SIZE_SMALL)->render() . '</a>') . ";";
             if ($this->getBackendUser()->checkAuthMode('tt_content', 'CType', 'shortcut', 'explicitAllow')) {
                 $pAddExtOnReadyCode .= "\n                        top.pasteReferencesAllowed = true;";
             }
         } else {
             $pAddExtOnReadyCode .= "\n                    top.pasteIntoLinkTemplate = '';\n                    top.pasteAfterLinkTemplate = '';";
//.........这里部分代码省略.........
开发者ID:stigfaerch,项目名称:gridelements,代码行数:101,代码来源:PageRenderer.php

示例12: loadCshJavascript

 /**
  * This loads everything needed for the Context Sensitive Help (CSH)
  *
  * @return void
  */
 protected function loadCshJavascript()
 {
     $this->pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/ContextHelp');
     $this->pageRenderer->addInlineSetting('ContextHelp', 'moduleUrl', BackendUtility::getModuleUrl('help_cshmanual'));
 }
开发者ID:adrolli,项目名称:TYPO3.CMS,代码行数:10,代码来源:DocumentTemplate.php

示例13: listTasks

    /**
     * Assemble display of list of scheduled tasks
     *
     * @return string Table of pending tasks
     */
    protected function listTasks()
    {
        // Define display format for dates
        $dateFormat = $GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'] . ' ' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['hhmm'];
        $content = '';
        // Get list of registered classes
        $registeredClasses = self::getRegisteredClasses();
        // Get list of registered task groups
        $registeredTaskGroups = self::getRegisteredTaskGroups();
        // add an empty entry for non-grouped tasks
        // add in front of list
        array_unshift($registeredTaskGroups, array('uid' => 0, 'groupName' => ''));
        // Get all registered tasks
        // Just to get the number of entries
        $query = array('SELECT' => '*', 'FROM' => 'tx_scheduler_task', 'WHERE' => '1=1', 'ORDERBY' => '');
        $res = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($query);
        $numRows = $GLOBALS['TYPO3_DB']->sql_num_rows($res);
        $GLOBALS['TYPO3_DB']->sql_free_result($res);
        // No tasks defined, display information message
        if ($numRows == 0) {
            /** @var $flashMessage FlashMessage */
            $flashMessage = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessage', $GLOBALS['LANG']->getLL('msg.noTasks'), '', FlashMessage::INFO);
            $content .= $flashMessage->render();
        } else {
            $this->pageRenderer->loadJquery();
            $this->pageRenderer->loadRequireJsModule('TYPO3/CMS/Scheduler/Scheduler');
            // Initialise table layout
            $tableLayout = array('table' => array('<table class="t3-table">', '</table>'), '0' => array('tr' => array('<thead><tr>', '</tr></thead>'), 'defCol' => array('<td>', '</td>'), '1' => array('<td style="width: 56px;">', '</td>'), '3' => array('<td colspan="2">', '</td>')), 'defRow' => array('tr' => array('<tr class="db_list_normal">', '</tr>'), 'defCol' => array('<td>', '</td>'), '1' => array('<td class="right">', '</td>'), '2' => array('<td class="right">', '</td>')));
            $disabledTaskRow = array('tr' => array('<tr class="db_list_normal disabled">', '</tr>'), 'defCol' => array('<td>', '</td>'), '1' => array('<td class="right">', '</td>'), '2' => array('<td class="right">', '</td>'));
            $rowWithSpan = array('tr' => array('<tr class="db_list_normal">', '</tr>'), 'defCol' => array('<td>', '</td>'), '1' => array('<td class="right">', '</td>'), '2' => array('<td class="right">', '</td>'), '3' => array('<td colspan="6">', '</td>'));
            $taskGroupRow = array('tr' => array('<tr class="db_list_normal">', '</tr>'), 'defCol' => array('<td>', '</td>'), '0' => array('<td colspan="10">', '</td>'));
            $table = array();
            $tr = 0;
            // Header row
            $table[$tr][] = '<a href="#" id="checkall" title="' . $GLOBALS['LANG']->getLL('label.checkAll', TRUE) . '" class="icon">' . IconUtility::getSpriteIcon('actions-document-select') . '</a>';
            $table[$tr][] = '&nbsp;';
            $table[$tr][] = $GLOBALS['LANG']->getLL('label.id');
            $table[$tr][] = $GLOBALS['LANG']->getLL('task');
            $table[$tr][] = $GLOBALS['LANG']->getLL('label.type');
            $table[$tr][] = $GLOBALS['LANG']->getLL('label.frequency');
            $table[$tr][] = $GLOBALS['LANG']->getLL('label.parallel');
            $table[$tr][] = $GLOBALS['LANG']->getLL('label.lastExecution');
            $table[$tr][] = $GLOBALS['LANG']->getLL('label.nextExecution');
            $tr++;
            foreach ($registeredTaskGroups as $taskGroup) {
                $query = array('SELECT' => '*', 'FROM' => 'tx_scheduler_task', 'WHERE' => 'task_group=' . $taskGroup['uid'], 'ORDERBY' => 'nextexecution');
                $res = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($query);
                $numRows = $GLOBALS['TYPO3_DB']->sql_num_rows($res);
                if ($numRows === 0) {
                    continue;
                }
                if ($taskGroup['groupName'] !== '') {
                    $tableLayout[$tr] = $taskGroupRow;
                    $groupText = '<strong>' . htmlspecialchars($taskGroup['groupName']) . '</strong>';
                    if (!empty($taskGroup['description'])) {
                        $groupText .= '<br />' . nl2br(htmlspecialchars($taskGroup['description']));
                    }
                    $table[$tr][] = $groupText;
                    $tr++;
                }
                // Loop on all tasks
                while ($schedulerRecord = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
                    // Define action icons
                    $editAction = '<a href="' . $GLOBALS['MCONF']['_'] . '&CMD=edit&tx_scheduler[uid]=' . $schedulerRecord['uid'] . '" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_common.xlf:edit', TRUE) . '" class="icon">' . IconUtility::getSpriteIcon('actions-document-open') . '</a>';
                    $deleteAction = '<a href="' . $GLOBALS['MCONF']['_'] . '&CMD=delete&tx_scheduler[uid]=' . $schedulerRecord['uid'] . '" onclick="return confirm(\'' . $GLOBALS['LANG']->getLL('msg.delete') . '\');" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_common.xlf:delete', TRUE) . '" class="icon">' . IconUtility::getSpriteIcon('actions-edit-delete') . '</a>';
                    $stopAction = '<a href="' . $GLOBALS['MCONF']['_'] . '&CMD=stop&tx_scheduler[uid]=' . $schedulerRecord['uid'] . '" onclick="return confirm(\'' . $GLOBALS['LANG']->getLL('msg.stop') . '\');" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_common.xlf:stop', TRUE) . '" class="icon">' . '<img ' . IconUtility::skinImg($this->backPath, ExtensionManagementUtility::extRelPath('scheduler') . '/Resources/Public/Images/stop.png') . ' alt="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_common.xlf:stop') . '" /></a>';
                    $runAction = '<a href="' . $GLOBALS['MCONF']['_'] . '&tx_scheduler[execute][]=' . $schedulerRecord['uid'] . '" title="' . $GLOBALS['LANG']->getLL('action.run_task') . '" class="icon">' . IconUtility::getSpriteIcon('extensions-scheduler-run-task') . '</a>';
                    // Define some default values
                    $lastExecution = '-';
                    $isRunning = FALSE;
                    $executionStatus = 'scheduled';
                    $executionStatusOutput = '';
                    $name = '';
                    $nextDate = '-';
                    $execType = '-';
                    $frequency = '-';
                    $multiple = '-';
                    $startExecutionElement = '&nbsp;';
                    // Restore the serialized task and pass it a reference to the scheduler object
                    /** @var $task \TYPO3\CMS\Scheduler\Task\AbstractTask|\TYPO3\CMS\Scheduler\ProgressProviderInterface */
                    $task = unserialize($schedulerRecord['serialized_task_object']);
                    $class = get_class($task);
                    if ($class === '__PHP_Incomplete_Class' && preg_match('/^O:[0-9]+:"(?P<classname>.+?)"/', $schedulerRecord['serialized_task_object'], $matches) === 1) {
                        $class = $matches['classname'];
                    }
                    // Assemble information about last execution
                    $context = '';
                    if (!empty($schedulerRecord['lastexecution_time'])) {
                        $lastExecution = date($dateFormat, $schedulerRecord['lastexecution_time']);
                        if ($schedulerRecord['lastexecution_context'] == 'CLI') {
                            $context = $GLOBALS['LANG']->getLL('label.cron');
                        } else {
                            $context = $GLOBALS['LANG']->getLL('label.manual');
                        }
                        $lastExecution .= ' (' . $context . ')';
//.........这里部分代码省略.........
开发者ID:Mr-Robota,项目名称:TYPO3.CMS,代码行数:101,代码来源:SchedulerModuleController.php

示例14: __construct

 /**
  * Construct
  */
 public function __construct()
 {
     $this->iconFactory = GeneralUtility::makeInstance(IconFactory::class);
     $this->fileRepository = GeneralUtility::makeInstance(FileRepository::class);
     $this->pageRenderer = GeneralUtility::makeInstance(PageRenderer::class);
     $this->pageRenderer->loadJquery();
     $this->pageRenderer->loadRequireJsModule('TYPO3/CMS/Recordlist/FieldSelectBox');
 }
开发者ID:hlop,项目名称:TYPO3.CMS,代码行数:11,代码来源:ElementBrowser.php


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